Merged
Conversation
Collaborator
Author
Member
|
Looks like a bug to me.. how high is the chance of some code breaking because of this change? |
Collaborator
Author
|
If you look the bug reported the snippet provided is broken after the upgrade #65.
|
Member
|
Mark it as 1.0.2. I don't think the library is really usable without this fix. |
|
This does not work with multiple extend, and I think it could fail on some cases users are using. const SCHEMA_V1 = S.object()
.prop(
'reason',
S.string()
.minLength(1)
)
.extend(SCHEMA_BASE)
const SCHEMA_NEW = S.object()
.prop(
'reason',
S.string()
.minLength(1)
)
.extend(SCHEMA_V1) |
Collaborator
Author
|
Tks for raise this. Can you add the expected result?
On Wed, 20 May 2020 at 09:51, Jure ***@***.***> wrote:
This does not work with multiple extend, and I think it could fail on some
cases users are using.
const SCHEMA_V1 = S.object()
.prop(
'reason',
S.string()
.minLength(1)
)
.extend(SCHEMA_BASE)
const SCHEMA_NEW = S.object()
.prop(
'reason',
S.string()
.minLength(1)
)
.extend(SCHEMA_V1)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJN2LHNCROMXTMJBPGX5FDRSOKYHANCNFSM4M4O726A>
.
--
Sent from mobile phone
|
|
Expected behavior: SCHEMA_V1 should have all definitions defined in SCHEMA_BASE + prop "reason" |
aboutlo
added a commit
that referenced
this pull request
May 28, 2020
3 tasks
aboutlo
added a commit
that referenced
this pull request
Jun 2, 2020
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Better merge strategy. Before, the merge was replacing the array element rather than merging the items.
I decided to block all the method after
.extendto avoid incorrect usage.Wrong but no error raised by FluentSchema
Correct usage should be:
First, the schema is defined with all the props then it extends the base schema.
With the sealed schema after the
.extendthe only thing that can be done is callingvalueOfI'm unsure if I should mark this as 1.0.2 because it's a bug fix or considering the sealing as breaking change. Feedback welcome.
Checklist
npm run testandnpm run benchmark